//引入Vue
import Vue from 'vue'
//引入App
import App from './App.vue'
//引入VueRouter 安装npm i vue-router@3
import VueRouter from 'vue-router'
//引入路由器
import router from './router'
//引入ElementUI
import ElementUI from 'element-ui';
import 'element-ui/lib/theme-chalk/index.css';
//引入vuex
import store from './store'

import global_ from './components/Global'//引用文件

import axios from 'axios';
Vue.prototype.$axios = axios;

/**
 * 配置请求拦截器
 */
axios.defaults.baseURL = "/"; //公共url

axios.interceptors.request.use(config => {
  return config
}, error => {
  // 异常
})

/**
 * 响应拦截器
 */
axios.interceptors.response.use(response => {
  return response
}, error => {
  // 异常
  return Promise.reject(error)
})

Vue.prototype.GLOBAL = global_//挂载到Vue实例上面


//关闭Vue的生产提示
Vue.config.productionTip = false
//应用插件
Vue.use(VueRouter)

Vue.use(ElementUI)

//创建vm
new Vue({
  el:'#app',
  store,
  render: h => h(App),
  router
})
